<template>
  <div>
    <div id="pmsg">
      <div style="line-height: 15px"><h4>商品预售许可证登记表</h4></div>
      <el-divider></el-divider>
      <el-form :model="allForm" size="small" label-width="120px">
        <el-row type="flex" justify="start" align="top">
          <el-col :span="6"> </el-col>
          <el-col :span="6"> </el-col>
          <el-col :span="6">
            <el-form-item label="照片:">
              <img src="https://s1.ax1x.com/2022/12/15/zoHMq0.png" width="100px" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="申请人基本信息 :"></el-form-item>
        <el-row type="flex" justify="start" align="top" :gutter="50">
          <el-col :span="6">
            <el-form-item label="申请人 :" prop="proposerName">
              <el-input
                v-model="allForm.proposerName"
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="9">
            <el-form-item label="户籍地址 :" prop="proposerAddress">
              <el-input
                v-model="allForm.proposerAddress"
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top" :gutter="50">
          <el-col :span="6">
            <el-form-item label="联系电话 :" prop="proposerPhone">
              <el-input
                v-model="allForm.proposerPhone"
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="证件号码 :" prop="proposerCard">
              <el-input
                v-model="allForm.proposerCard"
                placeholder="请输入证件号码"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top" :gutter="50">
          <el-col :span="6">
            <el-form-item label="代理人 :" prop="proxyName">
              <el-input
                v-model="allForm.proxyName"
                placeholder="请输入代理人"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="证件号码 :" prop="proxyCard">
              <el-input
                v-model="allForm.proxyCard"
                placeholder="请输入证件号码"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-divider></el-divider>
        <el-form-item label="楼盘基本信息 :"></el-form-item>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="6">
            <el-form-item label="建设单位:" prop="higherUnit">
              <el-input
                v-model="allForm.higherUnit"
                placeholder="请输入建设单位"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="项目名称 :" prop="higherName">
              <el-input
                v-model="allForm.higherName"
                placeholder="请输入项目名称"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="土地用途 :" prop="higherLandUse">
              <el-input
                v-model="allForm.higherLandUse"
                placeholder="请输入土地用途"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex" justify="start" align="top">
          <el-col :span="6">
            <el-form-item  prop="licenceId"></el-form-item>
            <el-form-item label="土地权属 :" prop="higherLandProperty">
              <el-input
                v-model="allForm.higherLandProperty"
                placeholder="请输入土地权属"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="房屋性质 :" prop="higherRoomType">
              <el-input
                v-model="allForm.higherRoomType"
                placeholder="请输入房屋性质"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="设计用途 :" prop="higherSpaces">
              <el-input
                v-model="allForm.higherSpaces"
                placeholder="请输入设计用途"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="6">
            <el-form-item label="区/县 :" prop="higherDistrict">
              <el-input
                v-model="allForm.higherDistrict"
                placeholder=""
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="建筑区划 :" prop="higherZoning">
              <el-input
                v-model="allForm.higherZoning"
                placeholder="请输入分户图"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="丘地号 :" prop="higherMound">
              <el-input
                v-model="allForm.higherMound"
                placeholder="请输入分户图"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex" justify="start" align="top">
          <el-col :span="6">
            <el-form-item label="土地证号 :" prop="higherLandCardno">
              <el-input
                v-model="allForm.higherLandCardno"
                placeholder=""
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="房屋结构 :" prop="higherBuildingStructure">
              <el-input
                v-model="allForm.higherBuildingStructure"
                placeholder="请输入分户图"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="取得方式 :" prop="higherSrcid">
              <el-input
                v-model="allForm.higherSrcid"
                placeholder="请输入分户图"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex" justify="start" align="top">
          <el-col :span="6">
            <el-form-item label="房屋坐落 :" prop="higherRoomRepose">
              <el-input
                v-model="allForm.higherRoomRepose"
                placeholder=""
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="土地性质 :" prop="higherLandNature">
              <el-input
                v-model="allForm.higherLandNature"
                placeholder="请输入分户图"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="土地使用年限 :" prop="higherUseyear">
              <el-input
                v-model="allForm.higherUseyear"
                placeholder="请输入分户图"
                clearable
                :style="{ width: '100%' }"
                disabled
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-divider></el-divider>

        <el-form-item label="申请交验证件 :" size="50px"></el-form-item>
        <el-row>
          <el-col :span="8">
            <el-form-item label="预售申请书一份 :"> </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="选择文件" prop="licenceApplication">
              <el-button
                type="primary"
                icon="el-icon-picture-outline"
                size="medium"
              >
                选择文件
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item
              label="项目负责人身份证明 :"
              prop="licenceIdentification"
            >
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="选择文件">
              <el-button
                type="primary"
                icon="el-icon-picture-outline"
                size="medium"
              >
                选择文件
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="土地使用权证 :" prop="licenceLurc">
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="选择文件">
              <el-button
                type="primary"
                icon="el-icon-picture-outline"
                size="medium"
              >
                选择文件
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="建设用地规划许可证 :" prop="licenceLup">
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="选择文件">
              <el-button
                type="primary"
                icon="el-icon-picture-outline"
                size="medium"
              >
                选择文件
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="建设工程规划许可证 :" prop="licencePpoce">
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="选择文件">
              <el-button
                type="primary"
                icon="el-icon-picture-outline"
                size="medium"
              >
                选择文件
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="施工许可证 :" prop="licenceXkz">
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="选择文件">
              <el-button
                type="primary"
                icon="el-icon-picture-outline"
                size="medium"
              >
                选择文件
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <el-form :model="checkForm">
        <el-form-item label="审批意见 : " size="50px"></el-form-item>
        <el-row>
          <el-col :span="14">
            <el-form-item label="审核意见 :" prop="reviewComment">
              <el-input v-model="checkForm.reviewComment" type="textarea" placeholder="请输入审核意见 ："
                :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="审核人 :" prop="approver">
              <el-input v-model="checkForm.approver" type="textarea" :autosize="{minRows: 4, maxRows: 4}"
                :style="{width: '100%'}"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
    </div>
    <el-row>
      <el-button type="primary" @click="submit">确认审批</el-button>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      allForm: {},
      pid:0,
      checkForm:{},

    };
  },
  methods: {
    loadAll() {
        this.$axios.get("presell-serv/Licences/queryPid/" + this.pid).then(res=>{
            if(res.data.code==200){
                this.allForm=res.data.data.licenceVO;
                this.checkForm.checkId=res.data.data.licenceVO.checkId;
            }else{
                this.$message.error(res.data.$message);
            }
        })
    },
    submit(){
        this.$axios.post("presell-serv/pcheck/update",{checkForm:this.checkForm,allForm:this.allForm}).then(res=>{
            if(res.data.code==200){
                this.$message.success(res.data.$message);
                this.$router.push("/Cmaking");
            }else{
                this.$message.error(res.data.$message);
            }
        });

    },

  },
  mounted(){
    this.pid=this.$route.query.proposerId;
    this.loadAll();
  }
};
</script>
